package com.xqc.web.controller;

import com.xqc.api.response.UserResponse;
import com.xqc.common.utils.XqcWebResult;
import com.xqc.web.client.UserFacadeClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Api(value = "用户信息",description = "类名==》UserController",tags = {"用户信息集合"})
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserFacadeClient userFacadeClient;

    @GetMapping("/queryAllUser")
    @ApiOperation(value = "获取所有用户")
    public XqcWebResult<List<UserResponse>> queryAllUser(){
        return  this.userFacadeClient.queryAll();
    }


    @GetMapping("/insert")
    @ApiOperation(value = "添加用户")
    public XqcWebResult<Boolean> insert(){
        return  this.userFacadeClient.insert();
    }

}
